﻿using FPPrinter.Models.Doc;
using FPPrinter.Models.Printers;
using FPPrinter.Models.SourceFiles;

namespace FPPrinter.Models
{
    public class AntiObject : IAntiObject
    {
        
        public static IAntiObject Instance = new AntiObject();
        public IOptimizedDoc GetGroupedDoc()
        {
            return new LongOptimizedDoc();
            
        }


        private Sys _sys;
        public Sys GetSys()
        {

            return _sys==null? Sys.Instance:_sys;
        }

        public SysVM GetSysVm()
        {
            return new SysVM(GetSys());
        }

        public MainWindow GetMainForm()
        {
            return new MainWindow(GetSysVm());
        }

        
        
        private ISourceFileManager _ISourceFileManager;
        private IPrinterManager _IPrinterManager;
        private IOptimizedDocManager _IOptimizedDocManager;

  

        public ISourceFileManager GetSourceFileManager()
        {
            return _ISourceFileManager==null?new SourceFileManager():_ISourceFileManager;

        }

        public IPrinterManager GetPrinterManager()
        {
            return _IPrinterManager==null?new PrinterManager():_IPrinterManager;

        }

        public IOptimizedDocManager GetOptimzedDocManager()
        {
            return _IOptimizedDocManager==null?new OptimizedDocManager():_IOptimizedDocManager;

        }
    }
}